package mosync.mobilelualiveditor;
import mosync.mobilelualiveditor.MessageThread.Message;

class Evaluator {
	Evaluator() {
	}

	public static Evaluator getSingleton() {
		if(evaluator == null) {
			return evaluator = new Evaluator();
		} else {
			return evaluator;
		}
	}

	public void evaluate(String code) {
		System.out.println("evaluating: " + code);
		
		if(server != null) {
	      server.postMessage(new Message("CommandRunProgram", code));	
		}
	}
	
	public void setServer(Server server) {
		this.server = server;
	}
	
	protected static Evaluator evaluator = null;

	protected Server server = null;	
}
